﻿using UnityEngine;
using System.Collections;

public class Float : MonoBehaviour {
	public float duration = 3.0f;
	public float speedScale = 0.5f;
	public AnimationCurve aniCurve;

	// Use this for initialization
	void Start () {
	
	}
	
	// Update is called once per frame
	void Update () {
		Vector3 speed = new Vector3 (0, aniCurve.Evaluate (Time.time/duration), 0) * speedScale;
		moveBy (speed);
	}

	private void moveBy(Vector3 speed)
	{
		transform.position += speed * Time.deltaTime;
	}
}
